<?php
session_regenerate_id();
session_start(); // start up your PHP session!
session_set_cookie_params(60*60*24*365, "/");

class BaseController extends CI_Controller {

	private static $context_path;

	public function __construct() {
		parent::__construct();
		self::$context_path = base_url().index_page()."/";
	}

	public static function getContextPath(){
		return self::$context_path;
	}

	public function master_view($content_view, $data)
	{
		$data['base'] = self::getContextPath();
		$data['content'] = $this->load->view($content_view, $data, true);
		if (isset($_SESSION['user'])) {
			$data['user'] = $_SESSION['user'];
		}
		$this->load->view('master', $data);
	}

}
?>